/* ************************************************************************

   Copyright:

   License:

   Authors:

************************************************************************ */

/* ************************************************************************

#asset(mmclient/*)

************************************************************************ */

/**
 * This is the main application class of your custom application "mmclient"
 */
qx.Class.define("mmclient.Application",
{
  extend : qx.application.Standalone,


  /*
  *****************************************************************************
     PROPERTIES
  *****************************************************************************
  */

  properties :
  {
    /**
    * Application History Object, used to grab the document id.
    * Example: http://localhost/client/index.html#1 <-- 1 is the document id.
    */
    appHistory :
    {
      check : "Object",
      init : null
    },
    
    /**
    * The currently logged in user.
    *
    */
    username :
    {
      check : "String",
      init : ""
    }
  },
  

  /*
  *****************************************************************************
     MEMBERS
  *****************************************************************************
  */

  members :
  {
    /**
     * This method contains the initial application code and gets called 
     * during startup of the application
     * 
     * @lint ignoreDeprecated(alert)
     */
    main : function()
    {
      // Call super class
      this.base(arguments);
      this.setAppHistory(qx.bom.History.getInstance());

      // Enable logging in debug variant
      if (qx.core.Variant.isSet("qx.debug", "on"))
      {
        // support native logging capabilities, e.g. Firebug for Firefox
        qx.log.appender.Native;
        // support additional cross-browser console. Press F7 to toggle visibility
        qx.log.appender.Console;
      }

      /*
      -------------------------------------------------------------------------
        Below is your actual application code...
      -------------------------------------------------------------------------
      */

      // Log into the system
      this.login = new mmclient.Login(this);
      this.getRoot().add(this.login, {edge:0});
      this.login.initialize();

    },
     
    
    /*
    *****************************************************************************
       DESTRUCTOR
    *****************************************************************************
    */
  
    destruct : function()
    {
      this._disposeObjects(
      "login",
      "viewer"
      );
    }
  }
});
